<%--
  Created by IntelliJ IDEA.
  User: JYC
  Date: 2022/4/14
  Time: 20:45:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<div class="easyui-layout" style="width: 100%;height: 100%">
    <div data-options="region:'north',split:true" title="按条件查询" style="width:100%; height: 110px">
        <form id="qryRents" method="post" style="margin:0;padding:5px 5px">
            <span style="margin-right:10px">
                <input name="rentid" class="easyui-textbox" label="出租单号:">
            </span>
            <span style="margin-right:10px">
                <input name="identity" class="easyui-textbox" label="客户编号:">
            </span>
            <span style="margin-right:10px">
                <label>出租单状态:</label>
                <input class="easyui-radiobutton" name="rentflag" value="1" label="已归还">&emsp;&emsp;&emsp;
                <input class="easyui-radiobutton" name="rentflag" value="0" label="出租中">&emsp;&emsp;&emsp;
                <input class="easyui-radiobutton" name="rentflag" value='' label="不选择" checked="true">
            </span>
            <span style="margin-right:10px">
                <input name="opername" class="easyui-textbox" label="业务人员:">
            </span>
        </form>
        <div align="center">
            <button onclick="qryRents()" class="easyui-linkbutton">查询</button>
            <button onclick="clearF()" class="easyui-linkbutton">清空</button>
        </div>
    </div>
    <div data-options="region:'center',title:'出租单列表',iconCls:'icon-ok'">
        <table class="easyui-datagrid" toolbar="#toolbar" pagination="true" rownumbers="true" id="tb_data_Rentlist" striped="true"
               data-options="url:'qryRents',method:'get',singleSelect:true,fit:true,fitColumns:true">
            <thead>
            <tr>
                <th data-options="field:'rentid'" width="50">出租单号</th>
                <th data-options="field:'price'" width="50">租金</th>
                <th data-options="field:'begindate'" width="50">起始日期</th>
                <th data-options="field:'returndate'" width="50">到期日期</th>
                <th data-options="field:'rentflag',align:'right',formatter:function(value){return value==1?'已归还':'出租中'}"
                    width="30">出租状态
                </th>
                <th data-options="field:'identity',align:'right'" width="60">客户编号</th>
                <th data-options="field:'carnumber'" width="60">车牌号码</th>
                <th data-options="field:'opername'" width="50">业务经理</th>
            </tr>
            </thead>
        </table>
    </div>
</div>
<script type="text/javascript">
    var url;

    function qryRents() {
        //将表单序列化为json对象
        var params = $("#qryRents").serializeJson();
        console.log(params);
        $("#tb_data_Rentlist").datagrid({
            queryParams: params
        });
    }

    function clearF() {
        $('#qryRents').form('clear')
    }
</script>
</body>
</html>
